#ifndef PROPERTY_H
#define PROPERTY_H

#include "node.h"
#include "type.h"

class Component;

class Property : public Node
{
public:
    Property(const QString& name, const Type& type, Node* initExpr, bool readonly, const QString& update, const YYLTYPE& loc);

    QString name() const { return m_name; }
    Node* initExpression() const { return m_initExpr; }
    bool readonly() const { return m_readonly; }
    QString updateScript() const { return m_update; }

    Component* component() const;

    virtual Type type() { return m_type; }

private:
    QString m_name;
    Type m_type;
    Node* m_initExpr;
    bool m_readonly;
    QString m_update;
};

#endif // PROPERTY_H
